<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>编辑属性</title>
	<hdjs />
	<css file="__PUBLIC__/Css/mod.base.css" />
	<js file='__PUBLIC__/Js/mod.attr.js' />
</head>
<body>
	<form action="" method="post" enctype='multipart/form-data' class='hd-form'>

			<div class="hd-menu-list">
				<ul>
					<li>
						<a  href="{:U('Type/index')}" >
							类型列表
						</a>
					</li>
					<li>
						<a  href="{:U('Attr/index',array('typeid'=>$_GET['typeid']))}" >
							属性列表
						</a>
					</li>
					<li class="active">
						<a  href="javascript:;">
							编辑属性
						</a>
					</li>
					<li>
						<a href="{:U('Attr/update_cache',array('typeid'=>$_GET['typeid']))}">
							更新缓存
						</a>
					</li>
				</ul>
			</div>
			<div class="hd-title-header">
            {$type}编辑属性
        	</div>
			<table class='hd-table hd-table-form hd-form'>
				<tbody>
					<tr>
						<th class="hd-w100">属性名称</th>
						<td>
							<input type="text" name="attr_name"  class='hd-w200' value='{$field.attr_name}'/>
						</td>
					</tr>
					<tr>
						<th class="hd-w100">排序</th>
						<td>
							<input type="text" name="sort"  class='hd-w200' value='0' value='{$field.sort}'/>
						</td>
					</tr>
					<tr>
						<th class="hd-w100">显示方式</th>
						<td>
							<label>
								<input type="radio" name='type' value='1' <if condition="$field['type'] eq 1">checked='checked'</if> /> 单选
							</label>
							<label>
								<input type="radio" name='type' value='2' <if condition="$field['type'] eq 2">checked='checked'</if>/> 多选
							</label>
						</td>
					</tr>
					<tr>
						<th class="hd-w100">是否有关联图集</th>
						<td>
							<label>
								<input type="radio" name='is_pic' value='1' <if condition="$field['is_pic'] eq 1">checked='checked'</if>/> 有
							</label>
							<label>
								<input type="radio" name='is_pic' value='0' <if condition="!$field['is_pic']">checked='checked'</if>/> 没有
							</label>
						</td>
					</tr>
					<tr>
						<th class="hd-w100">属性值</th>
						<td>
							<table>
								<foreach name='field.attr_value' item='v'>
								<tr>
									<th><input type="text" name='attr_value[][{$v.attr_value_id}]' class='w180' value='{$v.attr_value}'/></th>
									<td>
										<if condition='!$key'>
										<a href="javascript:;" onclick='add_attr(this)'>添加</a>
										<else />
										<a href="javascript:;" onclick='del_attr(this)'>删除</a>
										</if>
									</td>
								</tr>
								</foreach>
							</table>
						</td>
					</tr>
				</tbody>
			</table>

		<div class="hd-position-bottom">
			<input type="hidden" name='attr_id' value='{$Think.get.attr_id}' />
			<input type="hidden" name='typeid' value='{$Think.get.typeid}' />
			<input type="submit" class='hd-btn-primary hd-btn' value="编辑" />
			<input type="button" class="hd-btn" onclick="location.href='{:U('Attr/index',array('typeid'=>$_GET['typeid']))}'" value="返回"/>	
		</div>
	</form>
</body>
</html>